package com.chris.blog.service.impl;

import com.chris.blog.dao.SayDao;
import com.chris.blog.entity.po.SayPO;
import com.chris.blog.service.SayService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SayServiceImpl implements SayService {

    @Resource
    private SayDao sayDAO;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteByPrimaryKey(String id) {
        return sayDAO.deleteByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(SayPO record) {
        return sayDAO.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertSelective(SayPO record) {
        return sayDAO.insertSelective(record);
    }

    @Override
    public SayPO selectByPrimaryKey(String id) {
        return sayDAO.selectByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKeySelective(SayPO record) {
        return sayDAO.updateByPrimaryKeySelective(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKey(SayPO record) {
        return sayDAO.updateByPrimaryKey(record);
    }

    @Override
    public List<SayPO> selectAllDesc(Integer size){
        return sayDAO.selectAllDesc(size);
    }

}
